import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:niu_app/pages/model/homepage/news_model.dart';
import 'package:niu_app/views/homepage/news_widget.dart';
class news_Page extends StatefulWidget {

  @override
  _news_PageState createState() => _news_PageState();
}

class _news_PageState extends State<news_Page> {

  List notice=[
    {
      "id":"001",
      "state":0,
      "title":"系统消息",
      "title1":"您的跟单资产不足，无法跟随交易，请增加资产或选择其他...",
      "time":"2020/07/17 20:47:30"
    },
    {
      "id":"001",
      "state":0,
      "title":"广告消息",
      "title1":"您的跟单资产不足，无法跟随交易，请增加资产或选择其他...",
      "time":"2020/07/17 20:47:30"
    },
    {
      "id":"001",
      "state":1,
      "title":"系统消息",
      "title1":"您的跟单资产不足，无法跟随交易，请增加资产或选择其他牛人",
      "time":"2020/07/17 20:47:30"
    },
    {
      "id":"001",
      "state":1,
      "title":"注册消息",
      "title1":"您的跟单资产不足，无法跟随交易，请增加资产或选择其他牛人",
      "time":"2020/07/17 20:47:30"
    },
  ];
  @override
  Widget build(BuildContext context) {
    return Container(
        height: 400.h,
        child: MediaQuery.removePadding(
          context: context,
          removeTop: true,
          child:  ListView.builder(
            shrinkWrap: true,
            scrollDirection: Axis.vertical,
            physics:NeverScrollableScrollPhysics(),
            itemBuilder: (context,index){
              return newswidget(
                dataModel: newsmodel.fromJson(notice[index]),
              );
            },
            itemCount: notice.length,
          ),)
    );
  }
}
